#ifndef MEM_H
#define MEM_H
#include "romfile.h"
class mem {
public:
    mem(romfile *);
    void write_byte(unsigned short,unsigned char);
    void write_word(unsigned short,unsigned short);
    unsigned char read_byte(unsigned short);
    unsigned short read_word(unsigned short);
private:
    unsigned char * hram; //ff80->fffe
    unsigned char * oam; //fe00->fe9f
    unsigned char * ram; //c000->fdff 32KB of mem
    unsigned char * sram; //a000->bfff mem-mapped
    unsigned char * vram; //8000->9fff 16KB, mapped into 8KB
    const unsigned char * rom; //0->7fff 32KB
    int mapper;
    int rom_pages;
    int ram_pages;
    unsigned short rom_offset;
    unsigned short ram_offset;
    unsigned short vram_offset;
    bool mask_fw;
};
#endif
